﻿@model GitCandy.Models.CommitModel

@{
    ViewBag.Title = String.Format(SR.Shared_TitleFormat, String.Format(SR.Repository_CommitTitle, Model.Name, Model.ReferenceName ?? Model.Sha.ToShortSha(), Model.CommitMessageShort));
}

<h4>@Html.Link(Model)</h4>

@Html.Partial("_PathBar", Model.PathBar)

<div class="row">
    <div class="col-md-9">
        <pre>@Model.CommitMessage</pre>
        <strong title="@Model.Author">@Model.Author.Name</strong>
        <span>@SR.Repository_AuthoredAt</span>
        <span title="@Model.Author.When">@Model.Author.When.LocalDateTime.ToFullString()</span>
        @if (Model.Author != Model.Committer)
        {
            <strong title="@Model.Committer">@Model.Committer.Name</strong>
            <span>@SR.Repository_CommittedAt</span>
            <span title="@Model.Committer.When">@Model.Committer.When.LocalDateTime.ToFullString()</span>
        }
    </div>

    <div class="col-md-3 text-right">
        <div class="">@Html.ActionLink(Model.Sha.ToShortSha(), "Commit", new { path = Model.Sha })</div>
        <div class="">@Html.ActionLink(SR.Repository_Tree, "Tree", new { path = Model.Sha })</div>
        @Model.Parents.Length @SR.Repository_Parents
        @for (var index = 0; index < Model.Parents.Length; index++)
        {
            if (index > 0)
            {
                @Html.Raw(" + ")
            }
            var parent = Model.Parents[index];
            @Html.ActionLink(parent.ToShortSha(), "Commit", new { path = parent })
        }
    </div>
</div>

@Html.Partial("_Diff", Model)
